# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=networkmanager-pptp
pkgver=1.2.4
pkgrel=2
pkgdesc="NetworkManager VPN plugin for PPTP"
url="https://wiki.gnome.org/Projects/NetworkManager"
arch=(i686 x86_64)
license=(GPL)
_pppver=2.4.7
depends=(libnm libsecret "ppp=$_pppver" pptpclient)
makedepends=(libnm-gtk intltool python git)
_commit=7861022af7edcf4a26b01d30ad6b2f0bbc51e55e  # tags/1.2.4^0
source=("git+https://git.gnome.org/browse/network-manager-pptp#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd network-manager-pptp
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd network-manager-pptp
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd network-manager-pptp
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
    --libexecdir=/usr/lib/NetworkManager --disable-static \
    --with-pppd-plugin-dir=/usr/lib/pppd/$_pppver
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd network-manager-pptp
  make DESTDIR="$pkgdir" install
}
